@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  /* 基础颜色 */
  --foreground-rgb: 0, 0, 0;
  --background-start-rgb: 214, 219, 220;
  --background-end-rgb: 255, 255, 255;
  
  /* 主题颜色 */
  --primary-color: #667eea;
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-color: #764ba2;
  
  /* 背景颜色 */
  --bg-primary: rgba(255, 255, 255, 0.8);
  --bg-secondary: rgba(255, 255, 255, 0.9);
  --bg-gradient: linear-gradient(135deg, #fdf2f8 0%, #f3e8ff 25%, #e0e7ff 50%, #dbeafe 75%, #f0f9ff 100%);
  
  /* 文字颜色 */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  
  /* 边框颜色 */
  --border-primary: rgba(255, 255, 255, 0.3);
  --border-secondary: rgba(102, 126, 234, 0.2);
  --border-error: #fecaca;
  
  /* 阴影 */
  --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 10px 25px rgba(102, 126, 234, 0.3);
  
  /* Toast */
  --toast-bg: #ffffff;
  --toast-color: #000000;
  --toast-border: #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --foreground-rgb: 255, 255, 255;
    --background-start-rgb: 0, 0, 0;
    --background-end-rgb: 0, 0, 0;
    --toast-bg: #1f2937;
    --toast-color: #ffffff;
    --toast-border: #374151;
  }
}

.dark {
  /* 主题颜色 */
  --primary-color: #8b5cf6;
  --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  --secondary-color: #a855f7;
  
  /* 背景颜色 */
  --bg-primary: rgba(31, 41, 55, 0.8);
  --bg-secondary: rgba(31, 41, 55, 0.9);
  --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #2d1b69 100%);
  
  /* 文字颜色 */
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  
  /* 边框颜色 */
  --border-primary: rgba(75, 85, 99, 0.3);
  --border-secondary: rgba(139, 92, 246, 0.3);
  --border-error: #7f1d1d;
  
  /* 阴影 */
  --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 10px 25px rgba(139, 92, 246, 0.3);
  
  /* Toast */
  --toast-bg: #1f2937;
  --toast-color: #ffffff;
  --toast-border: #374151;
}

/* 简约 Instagram 风格 - 使用CSS变量 */
.instagram-light {
  background: var(--bg-gradient);
}

.instagram-card {
  background: var(--bg-primary);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-primary);
}

.instagram-button {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.instagram-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.instagram-input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.instagram-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.3s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

.animate-pulse-slow {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 悬浮效果 */
.hover-lift {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 3px;
}

/* 拖拽样式 */
.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.drag-over {
  background-color: rgba(102, 126, 234, 0.1);
  border: 2px dashed #667eea;
  border-radius: 12px;
}

/* 原生拖拽样式 */
[draggable="true"] {
  cursor: grab;
}

[draggable="true"]:active {
  cursor: grabbing;
}

.drag-over {
  background-color: rgba(102, 126, 234, 0.1);
  border: 2px dashed #667eea;
  border-radius: 12px;
}

.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

/* 拖拽位置指示器 */
.drag-indicator {
  pointer-events: none;
  z-index: 10;
}

.drag-indicator-before {
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.drag-indicator-after {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.drag-indicator-swap {
  position: absolute;
  inset: 0;
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid #8b5cf6;
  border-radius: 16px;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

/* 响应式设计 */
@media (max-width: 640px) {
  .instagram-light {
    background: linear-gradient(135deg, #fdf2f8 0%, #f3e8ff 100%);
  }
}

/* 加载动画 */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: '';
  }
  40% {
    content: '.';
  }
  60% {
    content: '..';
  }
  80%, 100% {
    content: '...';
  }
}